package com.cnsoft.portal.saas;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.cnsoft.framework.support.MyTokenCommonSupport;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * 超管登录
 * 
 * @author ZmSoft
 * @version 0.1.0 2018/3/1
 * @since 0.1.0 2018/3/1
 */
@Controller
// @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@RequestMapping(value = "/pc/1.0/saas")
public class PageSaasRegistController extends MyTokenCommonSupport {

	@RequestMapping(value = "/regist.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView doRegistPOST(HttpServletRequest request, HttpServletResponse response, String token) throws Exception {
		ModelAndView modelAndView = new ModelAndView("/saas/saas-regist-1");
		modelAndView.addObject("token", token);

		return modelAndView;
	}

	@RequestMapping(value = "/regist-2.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView doRegist2POST(HttpServletRequest request, HttpServletResponse response, String token) throws Exception {
		ModelAndView modelAndView = new ModelAndView("/saas/saas-regist-2");
		modelAndView.addObject("token", token);

		return modelAndView;
	}

	@RequestMapping(value = "/regist-3.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView doRegist3POST(HttpServletRequest request, HttpServletResponse response, String token) throws Exception {
		ModelAndView modelAndView = new ModelAndView("/saas/saas-regist-3");
		modelAndView.addObject("token", token);

		return modelAndView;
	}

	@RequestMapping(value = "/regist.ok", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView doRegistOKPOST(HttpServletRequest request, HttpServletResponse response, String token) throws Exception {
		ModelAndView modelAndView = new ModelAndView("/saas/saas-regist-3");
		modelAndView.addObject("token", token);

		return modelAndView;
	}

	@RequestMapping(value = "/password.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView doPasswordPOST(HttpServletRequest request, HttpServletResponse response, String token) throws Exception {
		ModelAndView modelAndView = new ModelAndView("/saas/saas-password");
		modelAndView.addObject("token", token);

		return modelAndView;
	}

	@RequestMapping(value = "/password.ok", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView doPasswordOKPOST(HttpServletRequest request, HttpServletResponse response, String token) throws Exception {
		ModelAndView modelAndView = new ModelAndView("/saas/saas-password-ok");
		modelAndView.addObject("token", token);

		modelAndView.addObject("code", "success");
		modelAndView.addObject("message", "找回成功");
		return modelAndView;
	}
}
